package com.example.demo.controller;

import com.example.demo.data.ResultDate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;


@RestController
public class GetCodeController {

    @RequestMapping("getCode")
    public ResultDate<String> produceCode(){
        Random random = new Random();
        int i = random.nextInt(9000) + 1000;
        String a = i + "";

        return new ResultDate<String>(1,200,"验证码已生成",a);

    }
}
